/* ===================================
 * 全局常量配置文件
 * Created by py on 2020/05/02.
 * Copyright 2020, Inc.
 * =================================== */
export const USER_INFO = 'UserInfo';
export const ACCESS_TOKEN = 'AccessToken';
export const TOKEN_TYPE = 'TokenType';
export const IS_LOGIN = 'IsLogin';
export const BJ_POINT_GROUP = 'BjPointGroup';
export const DISPERSED_LINE_GROUP = 'DispersedLineGroup';
export const FACE_GROUP = 'FaceGroup';
export const RESULT_WATER_COOLING_GROUP = 'resultWaterCoolingGroup';
export const SOLID_GROUP = 'SolidGroup';
export const WIREFRAME = 'Wireframe';
export const YS_LINE_GROUP = 'YsLineGroup'; //场景预设线
export const TEXTURE_GUIDED_POINT = 'textureGuidedPoint';
export const RESULT_WL_LINE_GROUP = 'resultWlLineGroup';
export const ModeTypeEnum = {
  solid: 'solid', // 体
  face: 'face', // 面
  wireframe: 'wireframe', // 线框
  disperseLine: 'disperseLine', // 离散线
  point: 'point', // 点
};

export const Breakpoints = {
  xs: 480,
  sm: 576,
  md: 768, // an alternative medium screen size
  lg: 992,
  xl: 1200,
  xxl: 1600,
};
export const SelectModeEnum = {
  solid: 'solid', // 选择体
  surface: 'surface', // 选择面
  line: 'line', // 选择线
  point: 'point', // 选择点
};
export const DrawEnum = {
	point: 'point',                         // 绘制点
	curve: 'curve',                         // 绘制曲线
	brokenLine: 'brokenLine',               // 绘制折线
	singleSpiralLine: 'singleSpiralLine',   // 绘单螺旋线
	doubleHelixLine: 'doubleHelixLine',     // 绘双螺旋线
	circle: 'circle',                       // 绘制圆
	zyx: 'zyx',                             // 自由线
};
// 颜色枚举
export const ColorEnum = {
  default: 0xcccccc, // 灰白色
  origin: 0xc8c8c8, // 灰色
  white: 0xffffff, // 白色
  black: 0x000000, // 黑色
  red: 0xff0000, // 红色
  pink: 0xffa7a7, // 粉红色
  green: 0x00ff00, // 绿色
  blue: 0x6362ff, // 蓝色
  yellow: 0xffff00, // 黄色
  cyanBlue: 0x00ffff, // 青蓝色
};
export const Widgets = {
  CROP: 'CROP',
};

// 渲染排序枚举
export const RenderOrderEnum = {
	result: {
		spaceOfPipe: 10,
		pipeline: 30,
		makePipe: 40,
		waterModel: 50,
		textureLine: 60,
		pipeLinePreview: 70,
	},
	solid: 100,
	face: 200,
	line: 300,
	point: 5,
	grid: 1,
};

// 水冷结果键
export const waterCoolingResultKeyMap = {
	pipeline: 'result_pipe_line',                           // 管线
	pipelineLength: 'pipelineLength',                       // 管线长度
	pipelineDesignSpace: 'result_design_space_of_pipe',     // 管线设计空间
	waterwayModel: 'result_include_water_model',            // 含水路模型
	waterwayModelLine: 'result_include_water_model_line',   // 含水路模型边框
	generatePipeline: 'result_make_pipe',                   // 生成管路
	generateTubePreview: 'result_pipe_line_preview',        // 生成管预览
};
// 纹理结果文件类型枚举
export const TextureResultTypeEnum = {
	visible2dWlLine: 'visible2dWlLine',     // 2D纹理线条模型
	visible2dWlVector: 'visible2dWlVector', // 2D纹理线条矢量
};
export const DEFAULT_VIEW_TYPE = 'View3D:default';

export const GradientRamp = [
  { start: '#333', end: '#999' },
  { start: '#85A8FF', end: '#B7C6FF' },
  { start: '#00002A', end: '#52576E' }, // from ParaView
  { start: '#C7D8E1', end: '#E3EAEE' },
];
export const DEFAULT_VIEW_BACKGROUND = `linear-gradient(${GradientRamp[3].start}, ${GradientRamp[3].end})`;

export const VIEW_TYPES_LPS = [
  { text: '3D', value: 'View3D:default' },
  // { text: 'Sagittal', value: 'View2D_Y:y' },
  // { text: 'Coronal', value: 'View2D_X:x' },
  // { text: 'Axial', value: 'View2D_Z:z' },
];

export const CURSOR_ANNOTATIONS = {
  se: '${valueArCursor}<br>${cursorIJK}&nbsp;/&nbsp;${cursorXYZ}<br>WL:&nbsp;${windowLevel}&nbsp;/&nbsp;WW:&nbsp;${windowWidth}',
};
export const VIEW_TYPES = [
  { text: '3D', value: 'View3D:default' },
  // { text: 'Orientation Y', value: 'View2D_Y:y' },
  // { text: 'Orientation X', value: 'View2D_X:x' },
  // { text: 'Orientation Z', value: 'View2D_Z:z' },
];
export const ANNOTATIONS = {
  s: 'Image&nbsp;size:&nbsp;${sliceWidth}&nbsp;x&nbsp;${sliceHeight}',
  nw: 'Origin:&nbsp;${sliceOrigin}<br>Spacing:&nbsp;${sliceSpacing}&nbsp;mm<br>${sliceIndex}&nbsp;of&nbsp;${sliceCount}',
  se: 'WL:&nbsp;${windowLevel}&nbsp;/&nbsp;WW:&nbsp;${windowWidth}',
};

export const VIEW_ORIENTATIONS = {
  default: {
    axis: 1,
    orientation: -1,
    viewUp: [0, 0, 1],
  },
  main: {
    axis: 2,
    orientation: 1,
    viewUp: [0, 1, 0],
  },
  back: {
    axis: 2,
    orientation: -1,
    viewUp: [0, 1, 0],
  },
  top: {
    axis: 1,
    orientation: 1,
    viewUp: [0, 0, -1],
  },
  bottom: {
    axis: 1,
    orientation: -1,
    viewUp: [0, 0, 1],
  },
  left: {
    axis: 0,
    orientation: -1,
    viewUp: [0, 1, 0],
  },
  right: {
    axis: 0,
    orientation: 1,
    viewUp: [0, 1, 0],
  },
};

export const ViewEnum = {
  default: 'default', // 默认视图
  main: 'main', // 主视图
  back: 'back', // 后视图
  top: 'top', // 俯视图
  bottom: 'bottom', // 仰视图
  left: 'left', // 左视图
  right: 'right', // 右视图
};

export const ViewOrientationEnum = {
  main: VIEW_ORIENTATIONS.main.viewUp, // 主视图
  back: VIEW_ORIENTATIONS.back.viewUp, // 后视图
  top: VIEW_ORIENTATIONS.top.viewUp, // 俯视图
  bottom: VIEW_ORIENTATIONS.bottom.viewUp, // 仰视图
  left: VIEW_ORIENTATIONS.left.viewUp, // 左视图
  right: VIEW_ORIENTATIONS.right.viewUp, // 右视图
};

export const ChooseEnum = {
  solid: 'solid', // 选择体
  face: 'face', // 选择面
  line: 'line', // 选择线
  point: 'point', // 选择点
  hide: 'hide', // 选择点
};

export const RenderModeEnum = {
  surface: 'surface', // 体
  wireframe: 'wireframe', // 线框
  surfaceAndWireframe: 'surfaceAndWireframe', // 体+线框
  translucent: 'translucent', // 体+线框+半透明
};

export const ViewModeEnum = {
  perspective: 'perspective', // 透视投影
  orthographic: 'orthographic', // 正交投影
};

export const RepresentationEnum = {
  // key: 'visibility:representation:edgeVisibility'
  Hidden: '0:-1:0',
  Points: '1:0:0',
  Wireframe: '1:1:0',
  Surface: '1:2:0',
  'Surface with Edge': '1:2:1',
};

export const SPECTRAL = [
  '#9E0142',
  '#D53E4F',
  '#F46D43',
  '#FDAE61',
  '#FEE08B',
  '#FFFFBF',
  '#E6F598',
  '#ABDDA4',
  '#66C2A5',
  '#3288BD',
  '#5E4FA2',
];

export const WIDGETS = [
  '#FFEE00',
  '#BBBE64',
  '#F3B700',
  '#91F5AD',
  '#FDCA40',
  '#F79824',
  '#E57C04',
];

export const DEFAULT_BACKGROUND = 'linear-gradient(#C7D8E1, #E3EAEE)';

// Specifications for vtkview background colors, images, and gradients
export const BACKGROUND = [
  '#000000',
  '#FFFFFF',
  ...SPECTRAL,
  'linear-gradient(#7478BE, #C1C3CA)', // from 3D Slicer default
  'linear-gradient(#00002A, #52576E)', // from ParaView
  DEFAULT_BACKGROUND,
];
// aaaa
export const WsTypeEnum = {
  dispersed: 'dispersed', // 离散数据
  mesh: 'mesh', // 网格数据
  resolve: 'resolve', // 求解器数据
  step: 'step', // 后处理动画(时间步)
  contact: 'contact', // 接触
  meshLog: 'meshLog', // 网格日志
  solveLog: 'solveLog', // 求解日志
};

export const RES_TYPE_ENUM = {
  DEPL: ['位移', 'RES_____DEPL'],
  EPEQ: ['等效应变', 'RES_____EPEQ_NOEU'],
  EPSI: ['应变', 'RES_____EPSI_NOEU'],
  SIEQ: ['等效应力', 'RES_____SIEQ_NOEU'],
  SIGM: ['应力', 'RES_____SIGM_NOEU'],
};

// 结果类型枚举
export const SOLVE_ENUM = {
  RES_____DEPL: {
    unit: 'm',
    cnName: '位移',
    compOpts: ['DX', 'DY', 'DZ'],
  },
  RES_____EPEQ_NOEU: {
    unit: '--',
    cnName: '等效应变',
    compOpts: [
      'INVA_2',
      'PRIN_1',
      'PRIN_2',
      'PRIN_3',
      'INVA_2SG',
      'VECT_1_X',
      'VECT_1_Y',
      'VECT_1_Z',
      'VECT_2_X',
      'VECT_2_Y',
      'VECT_2_Z',
      'VECT_3_X',
      'VECT_3_Y',
      'VECT_3_Z',
    ],
  },
  RES_____EPSG_NOEU: {
    unit: '--',
    cnName: '格林应变',
    compOpts: ['EPXX', 'EPYY', 'EPZZ', 'EPXY', 'EPXZ', 'EPYZ'],
  },
  RES_____EPSI_NOEU: {
    unit: '--',
    cnName: '柯西应变',
    compOpts: ['EPXX', 'EPYY', 'EPZZ', 'EPXY', 'EPXZ', 'EPYZ'],
  },
  RES_____SIEQ_NOEU: {
    unit: 'Pa',
    cnName: '等效应力',
    compOpts: [
      'VMIS',
      'TRESCA',
      'PRIN_1',
      'PRIN_2',
      'PRIN_3',
      'VMIS_SG',
      'VECT_1_X',
      'VECT_1_Y',
      'VECT_1_Z',
      'VECT_2_X',
      'VECT_2_Y',
      'VECT_2_Z',
      'VECT_3_X',
      'VECT_3_Y',
      'VECT_3_Z',
      'TRSIG',
      'TRIAX',
    ],
  },
  RES_____SIGM_NOEU: {
    unit: 'Pa',
    cnName: '柯西应力',
    compOpts: ['SIXX', 'SIYY', 'SIZZ', 'SIXY', 'SIXZ', 'SIYZ'],
  },
};

// 进度状态
export const ProgressDescEnum = {
  0: '未开始',
  1: '进行中',
  6: '后处理',
  8: '成功',
  9: '失败',
};
export const ProgressStatusEnum = {
  NOT_STARTED: 0, // 未开始
  LOADING: 1, // 进行中
  AFTER_PROCESS: 6, // 后处理
  SUCCESS: 8, // 成功
  FAIL: 9, // 失败
};

// 加密体类型
export const EncryptBodyTypeEnum = {
  Box: 'Box', // 长方体
  Cylinder: 'Cylinder', // 圆柱体
  Ball: 'Ball', // 球体
};

// 接触主从面颜色
export const ColorMap = {
  RED: '#D46363', // 红色
  GREEN: '#7CD44C', // 绿色
  BLUE: '#5176E8', // 蓝色
  WHITE: '#FFFFFF', // 白色
  SELECTED: '#0E3FFF', // 选中色
};

// 后处理动画类型
export const PostAnimationEnum = {
  clip: 'read_vtu_clip_animation', // 平面裁切动画
  crinkle: 'read_vtu_clip_crinkle_animation', // 波状裁切动画
  slice: 'read_vtu_slice_animation', // 切面裁切动画
  deformation: 'read_vtu_warpvector_animation', // 变形图动画
  solve: 'read_vtu_ordinary_animation', // 后处理动画(默认动画)
  animate: '',
};

// 后处理单步切换类型
export const PostSwitchEnum = {
  clip: 'read_vtu_clip_ordinary', // 平面裁切
  crinkle: 'read_vtu_clip_crinkle_ordinary', // 波状裁切
  slice: 'read_vtu_slice_ordinary', // 切面裁切
  deformation: 'read_vtu_warpvector_ordinary', // 变形图
  solve: 'read_vtu_switch', // 后处理
  animate: '',
};

// 播放类型
export const PlayEnum = {
  start: 'start',
  prev: 'prev',
  play: 'play',
  next: 'next',
  end: 'end',
};

// 帧类型
export const FrameEnum = {
  all: 1, // 所有帧
  current: 2, // 当前帧
};

// 项目类型
export const ProjectTypeEnum = {
  public: 0, // 公开项目
  private: 1, // 私有项目
};

// 参考平面
export const PlaneModeEnum = {
	planeXY: 'planeXY',
	planeYZ: 'planeYZ',
	planeXZ: 'planeXZ',
	planeDiyXY: 'planeDiyXY',
	planeDiyYZ: 'planeDiyYZ',
	planeDiyXZ: 'planeDiyXZ',
	curveNormalPlane: 'curveNormalPlane',
	curveTangentPlane: 'curveTangentPlane',
};
